home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Programming / Programming Languages / Yerk 3.64 / Module source / qPrint < prev    next >
Text File  |  1990-12-22  |  1KB  |  44 lines

  1. \ qprint - quick printer for Yerk source files
  2. \  4/24/86  rfd re-written to handle Mocwrite 4.2a tabs
  3. \  9/19/86  cdn re-written while handling tabs in grep
  4. \  9/01/88    rfl date now revision date - must use revised date source
  5. \  9/13/88    rfl    added getfileinfo:
  6.  
  7. :Module qpMod
  8.  
  9. // date
  10.  
  11. : .footer  pcr pcr  5  spaces 
  12.      ." Yerk source file: "   getName: topFile mfsname ptype
  13.      3 spaces topfile 76 + @ put: sysdate ." Rev: " print: sysDate
  14.         7 spaces ." Page"  . pcr np ;
  15.  
  16. String linBuf
  17.  
  18. \ get file and print it
  19. : qPrint  { \ theLine thePage ubase -- }
  20.     new: linBuf
  21.     base -> ubase decimal
  22.     'c drop -> emitVec   'c 2drop -> typeVec
  23.     1 -> theLine 1 -> thePage  +print
  24.     openReadOnly: topFile ?error 132 getfileinfo: topfile drop
  25.     BEGIN
  26.         topFile 255 readLine: linBuf 0=
  27.     WHILE
  28.         start: linBuf    \ expand tabs
  29.         BEGIN 9 charOf: linBuf
  30.         WHILE 4 mod 4 swap - >R pad 1 "     " drop R> replace: linBuf
  31.         REPEAT
  32.         theLine 5 .r space get: linBuf 90 min ptype pcr 1 ++> theLine
  33.         theLine 58 mod 0=
  34.         IF thePage .footer 1 ++> thePage THEN
  35.     REPEAT
  36.     theLine 58 mod 58 swap - 0
  37.     DO pcr LOOP  thePage .footer
  38.     -print 0 -> emitvec 0 -> typevec
  39.     release: linBuf
  40.     ubase -> base
  41. ;
  42.  
  43. ;Module
  44.